package jsyf.oa.entity.app;

import com.alibaba.fastjson.JSONObject;

import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.Table;

import jsyf.oa.ientity.BaseEntity;

@Entity
@Table(name = "t_app_drive", schema = "oa", catalog = "")
public class DriveEntity extends BaseEntity {

    private String userId;
    private Date createTime;
    private Date startTime;
    private String driveTime;
    private BigDecimal distance;

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    @Override
    public Date getCreateTime() {
        return createTime;
    }

    @Override
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getStartTime() {
        return startTime;
    }

    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }

    public String getDriveTime() {
        return driveTime;
    }

    public void setDriveTime(String driveTime) {
        this.driveTime = driveTime;
    }

    public BigDecimal getDistance() {
        return distance;
    }

    public void setDistance(BigDecimal distance) {
        this.distance = distance;
    }

    @Override
    public JSONObject getJSONObject() {
        JSONObject obj = new JSONObject();
        obj.put("ID", getId());
        obj.put("USER_ID", userId);
        obj.put("CREATE_TIME", createTime);
        obj.put("START_TIME", startTime);
        obj.put("DRIVE_TIME", driveTime);
        obj.put("DISTANCE", distance);
        return obj;
    }

    @Override
    public String getTableName() {
        return "t_app_drive";
    }

    @Override
    public JSONObject getJSONColumns() {
        JSONObject obj = new JSONObject();
        obj.put("ID", "id");
        obj.put("USER_ID", "userId");
        obj.put("CREATE_TIME", "createTime");
        obj.put("START_TIME", "startTime");
        obj.put("DRIVE_TIME", "driveTime");
        obj.put("DISTANCE", "distance");
        return obj;
    }

}
